package com.ohos.connect.devicecloud.mqtt.modular.mqtt.service;

import com.ohos.connect.devicecloud.mqtt.core.model.vo.MqttAccountVO;
import com.ohos.connect.devicecloud.mqtt.modular.mqtt.model.dto.MqttLoginDTO;
import org.eclipse.paho.mqttv5.client.MqttClient;
import org.eclipse.paho.mqttv5.common.MqttException;
import org.eclipse.paho.mqttv5.common.MqttMessage;
import org.springframework.http.ResponseEntity;

import java.util.Map;

public interface MqttService {

    /* 根据APP账户生成MQTT账户　*/
    MqttAccountVO getMqttAccountByDevice(String device);

    /* MQTT账户登录认证　*/
    ResponseEntity<Map<String,Object>> mqttLoginAuth(MqttLoginDTO loginDTO);

    /* 获取云平台的mqtt client　*/
    MqttClient getMqttClient();

    // 发送mqtt消息
    void sendMqttMessage(String topic, MqttMessage mqttMessage) throws MqttException;


}
